import ajax from '@/api/ajax'

const { url } = require("../../build/config");

// console.log(config)

//  url.base_url;
const base_url = `${url.base_url}/api/knowledge-tag`


export function tagsPage(data) {
  return ajax({
    url: `${base_url}/page`,
    method:'post',
    data:data
  })
}

export function getTagInfo(key) {
  return ajax({
    url: `${base_url}/${key}`,
    method:'get',
  })
}

export function getTagTree() {
  return ajax({
    url: `${base_url}/tree`,
    method:'get',
  })
}

export function addTag(data) {
  return ajax({
    url: `${base_url}`,
    method:'post',
    data:data,
    showMsg:true
  })
}

export function deleteTag(key) {
  return ajax({
    url: `${base_url}/${key}`,
    method:'delete',
    showMsg:true
  })
}

export function updateTag(data) {
  return ajax({
    url: `${base_url}`,
    method:'put',
    showMsg:true,
    data:data
  })
}


